前情提要: 研究方向

1.  完成之前未完成項目:板橋、三重、中和,Tueky Test...
2.  貢寮:夏季、時辰
3.  北海岸 (淡水、三芝、石門、金山)

1. 工作成果整理


2. 探索性資料分析

找出可供拿來模擬、建立模型、具代表性之歷史資料的決策過程。

決定分析行政區: 貢寮區

之所以選定貢寮區, 是因為發現新北市郊區和人口密集的市區比較起來, 普遍都有反應時間偏長消防分隊數量較少的現象,
評估巡迴方案效果可能會較都市區更為顯著, 於是選定貢寮區進行分析。


決定分析月份: 七月份

觀察下圖可知, 在歷年(2007-2012)歷史ems資料當中, 貢寮區 7月份案件數明顯高於其他月份, 於是選擇7月份作為建立模擬模型的資料來源。





決定分析時辰: 午未申酉

觀察下圖可發現, 歷年資料中, 貢寮區之案件量由中午過後逐漸提高。
由於案件量需要足夠高才有辦法測試現行系統耐受力, 且設定方案的目的為提高案件發生時救護車剛好在附近的機率, 引此選定案件量較多的午未申酉4個時辰做分別模擬以及合併模擬 [ 見系統模擬章節 ]

其他想法補充:

  1. 根據歷史資料觀察時辰對應平均反應時間的關係, 可以發現並不會因為案件量多而造成反應時間提高(原因不明)
  2. 寅時(3-5點)平均反應時間較長, 儘管案件量少可能不具代表性, 但對於改善反應時間的研究目的來說, 為潛在分析對象



3. 系統模擬

決定好欲分析目標資料來源後, 先利用R軟體計算好需要在AnyLogic中進行設定的參數(案件分布熱力矩陣,目標行政區經緯度,模擬時間長度,案件重心點座標…)後, 將其值代入軟體, 開始進行模擬。

##       hostpital      station_id 
##  貢寮衛生所:198   31312613:374  
##  基隆長庚  :131   31312512: 35  
##  瑞芳      : 15   31311211: 17  
##  台灣礦工  : 12   31311210:  9  
##  衛部基    :  8   31311103:  6  
##  (Other)   : 13   31311111:  6  
##  NA's      : 74   (Other) :  4
模型參數設定說明:
  • 運送醫院: 分析選定的歷史資料, 可發現大部分的ems案件都被送往貢寮衛生所以及基隆長庚, 但因為貢寮衛生所實為地區醫院, 故在模擬軟體中, 將救護車載到病人後的目的地設定為距離較遠、對實驗結果更嚴苛的基隆長庚
  • 消防分隊: 長達六年的歷史資料中發現超過八成(82.92%)的資料都是由某特定ID之分隊派遣救護車, 因此假設需要跨區派車的機率非常小, 另由於貢寮區目前只設有一消防分隊, 故合理推斷該ID為貢寮分隊。
  • 歷史案件分佈熱力矩陣: 將目標行政區切分為同等大小的25格方格矩陣, 計算每格累積案件量, 並採取輪盤法確保隨機模擬的過程中, 案件數的空間分布會符合歷史案件分布。
  • 歷史案件時間分佈: 前期研究中發現, 如果用歷史案件發生的時間設定empirical distribution, 軟體模擬過程中會出現問題, 因此在比對歷史資料的機率分配圖形後, 使用較近似的 polynomial distribution作為歷史案件的時間分布
  • 模擬時間長度: 以七月份、午時的貢寮區歷史案件為例, 模擬時間總長度為 22320分鐘(6年1個月 31天 2小時 60分鐘)
  • 駐守方案: 本研究提出, 用來改進救護車反應時間的方法。
  • 案件重心點座標: 救護車被設定採取駐守方案後, 將會前往從歷史資料中算出來的該時段案件重心點座標(使用kmeans方法), 等待案件發生。

實驗流程:

  1. 將撈取出來的歷史資料, 在沒有設定駐點方案的狀況下, 做30次隨機模擬, 並將模擬出來的反應時間, 與真實的反應時間做lm (假設真實反應時間與模擬反應時間之間有函數對應關係)
  2. 設定駐點方案, 將其中一台救護車設定為一開始便前往案件重心點待命, 另一台則留在原消防分隊, 做30次隨機模擬, 每次結果取平均後, 得出30組隨機時間長度

經轉換過的模擬結果如下表:

實際反應時間 未採取駐守方案 採取駐守方案
a 轉換前 轉換後 轉換前 轉換後
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell
Content Cell Content Cell Content Cell Content Cell Content Cell

4. 驗證結果



同場加映: have fun :)

歷年 [ 7月份 ] [ 午, 未, 申, 酉 ] 時辰空間分布互動地圖